﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PongApplication.Shapes
{
    public class Line : Shape
    {
        public int x1 { get; set; }

        public int y1 { get; set; }

        public int x2 { get; set; }

        public int y2 { get; set; }

        public override Rectangle boundingBox
        {
            get
            {
                return new Rectangle(base.x, base.y, Math.Max(x1, x2), Math.Max(y1, y2));
            }
        }

        public Line(int x1, int y1, int x2, int y2) : base(Math.Min(x1, x2), Math.Min(y1, y2))
        {
            this.x1 = x1;
            this.y1 = y1;
            this.x2 = x2;
            this.y2 = y2;
        }
    }
}
